<template>
    <van-tabs swipeable animated sticky :offset-top='100' :swipe-threshold='3.5'>
      <van-tab v-for="(val,i)  in allSort" :key="i" :title="val.menuname">
        <load-list class="mt20" :val='val'></load-list>
      </van-tab>
    </van-tabs>
</template>

<script type="text/ecmascript-6">
import { imgBox, newsTitle } from "../assets/data/menuData.js";
import LoadList from "./newslist/loadListchannel.vue";
export default {
    components: {
        LoadList
    },
    data() {
        return {
            imgBox,

            channel: this.$route.meta.path, //代表菜单种类
            allSort: [
                {
                    channel: this.$route.query.channel,
                    menuname: "All",
                    cid: ""
                }
            ]
        };
    },
    created() {
        this.innit();
    },
    methods: {
        //icon跳转
        innit() {
            if (this.channel == "tcl") {
                this.allSort[0].title = "Carbon  ";
            } else if (this.channel == "dc") {
                this.allSort[0].title = "Battery";
            } else if (this.channel == "dlg") {
                this.allSort[0].title = "EAF";
            }
            this.allSort = this.allSort.concat(
                this.$store.state.indexData.menuAllListpart[this.channel]
            );
        }
    }
};
</script>

<style scoped lang="less">
.mt20 {
    margin-top: 0.2rem;
}
</style>
